var logModule = angular.module('log', ['Service']);
logModule.controller('LogController', function($scope, $http){
	$scope.submitbtn = "立刻登陆";
	var sbm = document.getElementById("sbm")
	$scope.util = {
		logSuc : function(){
			sbm.classList.add("btn-success")
			$scope.submitbtn = "登陆成功"
		}
	};
	$scope.submit = function(){
		var data = {
			email: $scope.email.value,
			password: $scope.password.value
		}
		$http.post('/user/log', data).success(function(data){
			console.log(data)
			if(data.suc == true){
				$scope.util.logSuc()
			}else{
				
			}
		});
	};
});
